import request from '@/utils/request'
import store from 'store'

// 获取全局配置
export const apiCloudShopCurrentStore = () => request.get('cloudShop/getCurrentStore')

// 访客记录
export const apiCloudShopVisit = (data) => request.post("cloudShop/visit", {
	terminal: store.getters.client,
	...data
})

// 绑定店铺
export const apiCloudShopBindCode = (data) => request.post('cloudShop/bindCode', data)

/** S 运营商 **/
// 获取申请协议
export const apiCitySupplierIntroduce = () => request.get(
	'cloudShop/getIntroduce')

// 获取申请自定义字段
export const apiCloudShopStoreField = () => request.get(
	'cloudShop/getDiyApplyField')

// 提交申请
export const apiCloudShopStoreApply = params => request.post('cloudShop/apply', params)

//云店铺详情
export const apiCloudShopStoreInfo = (params) => request.get('cloudShop/detail', {
	params
})

// 获取关联客户
export const apiCloudShopStoreClient = params => request.get('cloudShop/storeClientLists', {
	params
})

// 保存设置
export const apiCloudShopSettingSave = params => request.post('cloudShop/settingSave', params)

// 更新店铺商品价格
export const apiUpdateStoreGoodsPrice = params => request.post('cloudShop/updateStoreGoodsPrice', params)



// S 商品
// 获取商品列表
export const apiCloudShopGoodsLists = params => request.get('cloudShop/goodsLists', {
	params
})

// 修改商品上下架
export const apiCloudShopEditGoodsStatus = params => request.post('cloudShop/editGoodsStatus', params)

// 商品改价
export const apiCloudShopEditGoodsPrice = params => request.post('cloudShop/editGoodsPrice', params)

// 商品批量改价
export const apiCloudShopBatchEditGoodsPrice = params => request.post('cloudShop/batchEditGoodsPrice', params)

// E 商品



// S 客户折扣等级

// 获取客户折扣等级
export const apiCloudShopStoreClientLevel = params => request.get('cloudShop/clientLevelLists', {
	params
})

// 新增折扣等级
export const apiCloudShopStoreClientLevelAdd = params => request.post('cloudShop/addClientLevel', params)

// 修改折扣等级
export const apiCloudShopStoreClientLevelEdit = params => request.post('cloudShop/editClientLevel', params)

// 删除折扣等级
export const apiCloudShopStoreClientLevelDel = params => request.post('cloudShop/delClientLevel', params)

// 修改客户折扣等级
export const apiCloudShopStoreClientEdit = params => request.post('cloudShop/editStoreClient', params)

// E 客户折扣等级




// S 提现

// 提现配置
export const apiWithdrawGetConfig = (params) => request.get('cloudShop/getWithdrawConfig', {
	params
})

// 提现申请
export const apiWithdrawApply = (params) => request.post('withdraw/apply', params)

// 提现申请列表
export const apiWithdrawLists = (params) => request.get('withdraw/lists', {
	params
})

// 提现详情
export const apiWithdrawDetail = (params) => request.get('withdraw/detail', {
	params
})
// E 提现



//用户端
/** S 商品 **/
// 获取首页商品列表
export const apiGoodsLists = params => request.get('cloudShop/goodslists', {
	params
})

// 商品分类
export const apiGoodsCategory = () => request.get('cloudShop/categorylists')




/** S 订单 **/
// 结算订单 | 提交订单
// 订单列表
export const apiCloudShopOrderList = params => request.get('cloudShop/orderLists', {
	params
})

// 订单详情
export const apiCloudShopOrderDetail = params => request.get('cloudShop/orderDetail', {
	params
})

/** E 订单 **/


/** S 售后 **/
// 获取提交售后子订单商品信息
export const apiCloudShopAfterSaleGoods = params => request.get('cloudShop/afterSaleOrderGoodsInfo', {
	params
})

// 提交售后商品申请
export const apiCloudShopAfterSalePost = params => request.post('cloudShop/afterSaleApply', params)

// 售后列表
export const apiCloudShopAfterSaleList = params => request.get('cloudShop/afterSaleLists', {
	params
})

// 售后详情
export const apiCloudShopAfterSaleDetail = params => request.get('cloudShop/afterSaleDetail', {
	params
})

// 填写快递单号
export const apiCloudShopExpressInfo = params => request.post('cloudShop/afterSaleReturnGoods', params)
/** E 售后 **/